/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:26554
 * Date:2024-11-13
 * Time:12:55
 */

class Person{
    private String name;
    private int age;

public Person(String name,int age){
    this.name = name;
    this.age = age;
   }

   public boolean equals(Object obj){
    if(obj==null)
        return false;
    if(obj==this)
        return true;
    if(!(obj instanceof Person))
        return false;
    Person n2 =(Person)obj;
    return this.name == n2.name&&this.age == n2.age;

   }

}


public class Text {
    public static void main(String[] args) {
     Person n1 = new Person("小米",17);

     Person n2 = new Person("小米",17);

        System.out.println(n1.equals(n2));
    }
}
